test(label): add Mac sidecar g4 regression test for channel labeler#20
Merged
Merged
Conversation
Add `test_mac_sidecar_g4_default_assigns_you_via_margin` to `TestLabelSpeakersFromChannels`, a synthetic stereo fixture calibrated to reproduce the per-speaker `mic_ratio` profile that meetscribe-record produces on macOS at the M4.5 production default (`MicCapture.defaultGain = 4.0`, shipped in meetscribe-record 7b4a6fd). The existing labeler tests cover three regimes well: - `test_assigns_you_to_mic_dominant` you_ratio = 0.923 - `test_no_mic_dominant_speaker_all_remote` you_ratio = 0.024 - `test_sensitive_condenser_mic_…_margin` you_ratio = 0.593 None of them lands `you_ratio` in the 0.20-0.30 band that the Mac sidecar actually produces — the band where the labeler's absolute `> 0.5` shortcut does not fire and the relative-margin branch (`margin > 0.1 AND you_ratio > 0.15`) is the only thing assigning the YOU label. The Mac path has been running through that margin branch since M4.5 closed, but no test pinned it down. Any future tuning of either side — sidecar gain, labeler thresholds — could regress it silently. Calibration source is patternn's M6c.ii.b sign-off run (2026-05-14, meetscribe-record 0.2.0a1, Apple M1 / macOS 26.4.1), which reported `you_ratio = 0.242` after a controlled stereo recording. The new test reproduces that ratio almost exactly: `mic_ratio = 0.240` with margin 0.208 over the two synthetic remote speakers (whose ratios sit near 0.032). Three speakers (one YOU, two REMOTE) so the `REMOTE_1`/`REMOTE_2` branch is exercised. This is part of M7 in epic pretyflaco/meetscribe-record#1. Live end-to-end validation against patternn's actual Mac WAV is the matching deliverable; the synthetic test here is the contract that keeps the Mac path from drifting between runs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds one synthetic regression test to
TestLabelSpeakersFromChannelsthat pins down the channel labeler's behavior on stereo recordings
produced by meetscribe-record's macOS sidecar at the M4.5 production
default (
MicCapture.defaultGain = 4.0, shipped inmeetscribe-record commit 7b4a6fd).
The new test reproduces the per-speaker
mic_ratioprofile patternnobserved on Apple M1 during M6c.ii.b sign-off (2026-05-14):
you_ratio = 0.240(target was 0.242 from his run), margin 0.208over two remote speakers whose ratios sit at 0.032. This forces the
relative-margin branch of the labeler gate
(
margin > 0.1 AND you_ratio > 0.15) to be the path under test —the absolute
> 0.5shortcut intentionally does not fire, becausethe Mac path never produces ratios that high.
Why this test, why now
The existing labeler tests cover three regimes:
test_assigns_you_to_mic_dominanttest_no_mic_dominant_speaker_all_remotetest_sensitive_condenser_mic_…_via_marginNone of them lands
you_ratioin the 0.20–0.30 band thatmeetscribe-record produces on macOS in production. The Mac path has
been running through the margin branch since M4.5 closed (see
meetscribe-record PR #5 / issue #6 for the gain decision), but no
test pinned that contract. Future tuning of either side — sidecar
gain on macOS or labeler thresholds in meetscribe — could regress
the Mac path silently.
Verification
pytest tests/test_transcribe.py::TestLabelSpeakersFromChannelsgoes from 5 ✓ to 6 ✓ locally on Python 3.10.12 / pytest 8.4.2.
Channel analysis:log line showsSPEAKER_00: mic_ratio=0.240,Best candidate ratio=0.240 margin=0.208 over avg=0.032, and final labels{SPEAKER_00: YOU, SPEAKER_01: REMOTE_1, SPEAKER_02: REMOTE_2}—matching the M4.5 g4 expectation.
Context
m6ciib-test.session.jsonfrom theM6c.ii.b sign-off round (2026-05-14, meetscribe-record 0.2.0a1).
the matching deliverable; that round is being scheduled separately.
The synthetic test here is the contract that survives between live
rounds.